﻿#parse("partials/headerpopup.html")
<script>
    jQuery(document).ready(function () {
        jQuery("#mws-validate").submit(
            function () {
                if (jQuery("#mws-validate").valid() == true) {
                    jQuery.blockUI();
                    var post_data = jQuery(this).serialize();
                    var form_action = jQuery(this).attr("action");
                    var form_method = jQuery(this).attr("method");
                    jQuery.ajax({
                        type: form_method,
                        url: form_action,
                        cache: false,
                        dataType: "json",
                        data: post_data,
                        success: function (data) {
                            if (data['strNotification'] == "1") {
                                parent.CloseDialog();
                                parent.SetExtDoctor(data['DoctorId'], data['DoctorName'], data['TitleBeforeName'], data['TitleAfterName']);
                            } else {
                                alert(data['strNotification']);
                            }
                            jQuery.unblockUI();
                        },
                        error: function (data) {
                            jQuery.unblockUI();
                        },
                        complete: function () {

                        }
                    });
                }
                return false;
            });

        $("#buttonCancel").click(
            function () {
                parent.CloseExtDoctorDialog();
            }
        );
        $("#mws-form-dialog-address").dialog({
            width: 800,
            height:450,
            zIndex: 77,
            modal: true,
            autoOpen: false
        });

        });
       
        function OpenPopUpAddress() {
            $("#mws-form-dialog-address").dialog("open");
            $("#modalIframeFormAddress").attr("src", rooturl + "home/popup/popupsearcharea");
            return false;
        }
        function setAreaTextBox(AreaId, AreaName, CityId, CityName, CountryId, CountryName, ProvinceId, ProvinceName) {
            $("#TextBoxAreaPresent").val(AreaName);
            $("#HiddenPresentAddressAreaId").val(AreaId);
            $("#HiddenPresentAddressCityId").val(CityId);
            $("#TextBoxCityPresent").val(CityName);
            $("#TextBoxStatePresent").val(ProvinceName);
            $("#HiddenPresentAddressCountryId").val(CountryId);
            $("#TextBoxCountryPresent").val(CountryName);
            $("#HiddenPresentProvinceId").val(ProvinceId);
            $('#modalIframeFormAddress').attr('src', '');
            $("#mws-form-dialog-address").dialog("close");
        }
</script>

<!--<script type="text/javascript">
    $(document).ready(function () {
        $("#buttonSubmit").click(
            function () {
                parent.SetExtDoctor($("#TextBoxDoctorCode").val(), $("#TextBoxDoctorName").val());
            }
        );
       
    });
    //End Document.ready
   
</script>-->
<div class="mws-form" action="#">
<form action="/frontoffice/registration/addexternaldoctorpost/" id="mws-validate" method="post">
    <div class="grid_8">
        <div class="mws-form-inline">
            <div class="mws-panel-body">
                <div class="grid_4">
                    <div class="mws-form-inline">
                    <br />
                        <div class="mws-form-row">
                            <label>
                                Doctor Name <span style="color: #FF0000; font-size: medium;">*</span>
                            </label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-3-8 alpha">
                                        <div class="mws-form-item">
                                            $DdDoctorSalutation
                                        </div>
                                    </div>
                                    <div class="mws-form-col-5-8 alpha">
                                        <div class="mws-form-item">
                                            <input class="mws-textinput required" id="TextBoxDoctorName" name="FullName" type="text" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Academic Title <span style="color: #FF0000; font-size: medium;">*</span>
                                </label>
                            <div class="mws-form-item small">
                                $DdDoctorTitle
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Doctor Code <span style="color: #FF0000; font-size: medium;">*</span>
                            </label>
                            <div class="mws-form-item small">
                                <input class="mws-textinput required" id="TextBoxDoctorCode" name="DoctorCode" type="text" />
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Specialist <span style="color: #FF0000; font-size: medium;">*</span>
                                </label>
                            <div class="mws-form-item large">
                                $ddlSpecialists
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Medical Council</label>
                            <div class="mws-form-item large">
                                <input class="mws-textinput" id="TextBoxMedicalCouncil" name="MedicalCouncil"
                                    type="text" />
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Referal Institution Type</label>
                            <div class="mws-form-item large">
                                <input class="mws-textinput" id="TextBoxReferalInstitution" name="ReferalInstitutionType"
                                    type="text" />
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Institution Name (Hospital)</label>
                            <div class="mws-form-item large">
                                <input class="mws-textinput" id="TextBoxHospital" name="ReferalInstitution" type="text" />
                            </div>
                        </div>
                    </div>
                   
                </div>
                <div class="grid_4">
                <br />
                    <div class="mws-form-row">
                        <label>
                            Address <span style="color: #FF0000; font-size: medium;">*</span>
                        </label>
                        <div class="mws-form-item">
                            <input id="TextBoxAddressDescPresent" name="AddressDesc" value="" type="text"
                                class="mws-textinput required" />
                            <input type="hidden" id="HiddenPresentAddressId" name="Id" value="" />
                        </div>
                    </div>
                    <div class="mws-form-row">
                        <label>
                            Area</label>
                        <div class="mws-form-item">
                            <div class="mws-form-cols clearfix">
                                <div class="mws-form-col-6-8 alpha">
                                    <div class="mws-form-item">
                                        <input id="TextBoxAreaPresent" name="PresentAreaName" value="" type="text" class="mws-textinput"
                                            readonly="readonly" style="background-color: #F2F2F2;" />
                                        <input id="HiddenPresentAddressAreaId" type="hidden" name="AreaId"
                                            value="" />
                                    </div>
                                </div>
                                <div class="mws-form-col-2-8">
                                    <div class="mws-form-item">
                                        <input type="button" class="mws-button green small ButtonSearchPresentArea" addresstype="present"
                                            name="ButtonSearchPresentArea" value="Search" onclick="OpenPopUpAddress()"
                                            style="margin-top: 0; width: 85px;" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="mws-form-row">
                        <label>
                            City</label>
                        <div class="mws-form-item">
                            <input id="TextBoxCityPresent" name="PresentCityName" value="" type="text" class="mws-textinput"
                                readonly="readonly" style="background-color: #F2F2F2;" />
                            <input id="HiddenPresentAddressCityId" type="hidden" name="CityId"
                                value="" />
                        </div>
                    </div>
                    <div class="mws-form-row">
                        <label>
                            Province</label>
                        <div class="mws-form-item">
                            <input id="TextBoxStatePresent" value="" name="PresentProvinceName" type="text" class="mws-textinput"
                                readonly="readonly" style="background-color: #F2F2F2;" />
                            <input id="HiddenPresentProvinceId" name="ProvinceId" type="hidden"
                                value="" />
                        </div>
                    </div>
                    <div class="mws-form-row">
                        <label>
                            Country</label>
                        <div class="mws-form-item">
                            <input id="TextBoxCountryPresent" name="PresentCountryName" value="" type="text"
                                class="mws-textinput" readonly="readonly" style="background-color: #F2F2F2;" />
                            <input id="HiddenPresentAddressCountryId" name="CountryId" type="hidden"
                                value="" />
                        </div>
                    </div>
                    <div class="mws-form-row">
                        <label>
                            PIN/ZIP/Code</label>
                        <div class="mws-form-item">
                            <input id="TextBoxZipCodePresent" name="ZipCode" type="text" class="mws-textinput"
                                value="" maxlength="10" />
                        </div>
                    </div>
                    <div class="mws-form-row">
                        <label>
                            Phone Number
                        </label>
                        <div class="mws-form-item large">
                            <input id="TextBoxPhoneNumberPresent" name="PhoneNumber" type="text" class="mws-textinput"
                                value="" maxlength="15" />
                        </div>
                    </div>
                     <div class="mws-form-row">
                        <label>
                            Mobile Phone</label>
                        <div class="mws-form-item large">
                            <input class="mws-textinput" id="TextBoxMobile" name="Mobile" type="text" maxlength="20"/>
                        </div>
                    </div>
                    <div class="mws-form-row">
                        <label>
                            Email</label>
                        <div class="mws-form-item small">
                            <input class="mws-textinput email" id="TextBoxEmail" name="Email" type="text" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="clear15">
    </div>
    <div class="mws-button-row">
        <input name="buttonSubmit" id="buttonSubmit" type="submit" value="Submit" class="mws-button red" />
        <input name="buttonCancel" id="buttonCancel" type="submit" value="Cancel" class="mws-button gray" />
    </div>
</form>
</div>
<div id="mws-form-dialog-address">
    <iframe id="modalIframeFormAddress" width="100%" height="100%" marginwidth="0" marginheight="0"
        frameborder="0" scrolling="auto" title="Dialog Title">Your browser does not support</iframe>
</div>
#parse("partials/footerpopup.html") 